<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登录</title>
    <link rel="stylesheet" href="__STATIC__/admin/css/login.css">
    <!-- 作者QQ:951252660 -->
</head>

<body>
<div class="login">
    <div class="center">
        <h1>登录</h1>
        <div class="inputLi">
            <strong>账户</strong>
            <input type="text" name="username" class="username" placeholder="请输入账号...">
        </div>
        <div class="inputLi">
            <strong>密码</strong>
            <input type="text" name="password" class="password" placeholder="请输入密码...">
        </div>
        <div class="inputLi">
            <button onclick="login()">登录</button>
        </div>
        <p class="tip">关注17素材网</p>
    </div>
</div>
</body>
</html>
<script src="https://upcdn.b0.upaiyun.com/libs/jquery/jquery-2.0.2.min.js"></script>
<script>
    function login() {
        var username = $('.username').val();
        var password = $('.password').val();
        if (username == '') {
            alert('注册账号不能为空')
        }
        if (password == '') {
            alert('注册密码不能为空')
        }
        $.ajax({
            'url': "http://www.api.com/user/user/doLogin",
            'type': 'GET',
            'data': {
                'username': username,
                'password': password
            },
            'dataType': 'JSON',
            success: function (e) {
                console.log(e)
                // location.href = ""；

            }

        })

    }
</script>
</title>
</head>
<body>

</body>
</html>